package com.wanxin.car.carmng.model;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.wanxin.car.util.helper.CodeHelper;

/**
 * 修理厂信息
 * @author lqk
 */
@Entity
@Table(name="tRepair")
public class Repair implements Serializable{

	private static final long serialVersionUID = 1L;
	
//	1代表钣金、2代表机修、3代表刷车
	public static final String TYPE_SHEETMETAL = "1";
	public static final String TYPE_MACHINES = "2";
	public static final String TYPE_CLEAN = "3";
	
	public static final Map<String, String> TYPES = new LinkedHashMap<String, String>();
	
	static{
		TYPES.put(TYPE_SHEETMETAL, "钣金");
		TYPES.put(TYPE_MACHINES, "机修");
		TYPES.put(TYPE_CLEAN, "刷车");
	}
	
	@Id
	@GeneratedValue(generator="my")
	@GenericGenerator(name="my", strategy="uuid")
	@Column(name="cRepairID")
	private String id;

	@Column(name="cRepairName")
	private String name;

	@Column(name="cRepairTel")
	private String tel;

	@Column(name="cRepairType")
	private String type;
	
	

	public Repair() {
	}
	
	/**
	 * id
	 */
	public Repair( String id) {
		this.id = id;
	}

	/**
	 * 类型中文显示
	 */
	public String getTypeStr(){
		return TYPES.get(type);
	}
	

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public static void main(String[] args) {
		CodeHelper.printEntity("tRepair");
	}
}
